<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <!--头部固定引用-->
  <meta charset="utf-8">
  <meta name="full-screen" content="yes">
  <meta name="x5-fullscreen" content="true">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
  <link rel="stylesheet" href="../../css/base.css">
  <!--固定引用结束,自定义引用添加在下面-->
  <title>JT2</title>
  <!--页面样式添加在这里，多看看base。css里面的公共样式，大部分常用的都有，避免使用独立css文件为单独页面设置样式，避免随意添加样式到公共样式-->
  <style>
      .messagedetail-header {
        padding:0.22rem 0.32rem 1.44rem;  
        background:url(../../images/allPic/xiaoxibeijing.png);
      }
      .header-title {
        font-family: PingFangSC-Medium;
        font-size: 0.32rem;
        color: #fff;
        letter-spacing: 0;
        text-align: center;
        /* position: relative; */
        font-weight: 500;
        position: relative;
        width: 100%;
      }
      .header-title img {
          width: 0.32rem;
          height: 0.32rem;
          position: absolute;
          left: 0;
          top: 50%;
          transform: translateY(-50%);
      }
      .header-feedback {
          margin-top: 0.58rem;
      }
      .header-feedback img {
          width: 0.34rem;
          height: 0.3rem;
          margin-right: 0.18rem;
          vertical-align: middle;
      }
      .header-feedback span{
        height: 0.44rem;
        font-size: 0.32rem;
        font-family: PingFangSC, PingFangSC-Medium;
        font-weight: 500;
        text-align: left;
        color: #ffffff;
        line-height: 0.44rem;
        vertical-align: middle;
      }
       .sysexplain-content .explain-content-top .type{
           margin-right: 0.64rem;
       }
       .imgBox img{
        width: 1.48rem;
        height: 1.48rem;
        margin-right: 0.4rem;
       }
       /*  */
       .sysmessagedetail-contentBox {
  padding: 0 0.32rem;
  height: 1.9rem;
  position: relative;
}
.sysmessagedetail-contentBox .mainContent {
  height: 2.76rem;
  border-radius: 0.14rem;
  box-shadow: 0px 0px 0.32rem 0px rgba(0,0,0,0.1); 
  position: absolute;
  top: -0.86rem;
  left: 0.32rem;
  right: 0.32rem;
  padding: 0 0.3rem 0 0.42rem;
}
.sysmessagedetail-contentBox .mainContent-top {
  height: 2rem;
  font-size: 0.28rem;
  font-family: PingFangSC, PingFangSC-Regular;
  font-weight: 400;
  text-align: left;
  line-height: 0.4rem;
  padding: 0.38rem 0 0.42rem 0;
}
.sysmessagedetail-contentBox .mainContent-bottom{
  padding: 0.18rem 0 0.22rem 0;
  height: 0.74rem;
  font-size: 0.24rem;
  font-family: PingFangSC, PingFangSC-Regular;
  font-weight: 400;
  text-align: left;
 }
 .sysexplain-content {
  padding: 0.44rem 0.32rem 0.52rem;
}
.sysexplain-content .explain-content-top {
  height: 0.44rem;
  font-size: 0.32rem;
  font-family: PingFangSC, PingFangSC-Medium;
  font-weight: 500;
  text-align: left;
  line-height: 0.44rem;
  width: 100%;
  position: relative;
  margin-bottom: 0.56rem;
 }
 .sysexplain-content .explain-content-top .name{
  font-size: 0.28rem;
  font-family: PingFangSC, PingFangSC-Regular;
  font-weight: 400;
  text-align: left;
 }
 .sysexplain-content .explain-content-top .time{
  position: absolute;
  right: 0;
  font-size: 0.24rem;
  font-family: PingFangSC, PingFangSC-Regular;
  font-weight: 400;
  text-align: left;
 }
 .sysexplain-content .explain-content-title {
  height: 0.44rem;
  font-size: 0.32rem;
  font-family: PingFangSC, PingFangSC-Medium;
  font-weight: 500;
  text-align: left;
  line-height: 0.44rem;
  margin-bottom: 0.24rem;
 }
 .sysexplain-content .explain-content-main {
  /* height: 60px; */
  font-size: 0.28rem;
  font-family: PingFangSC, PingFangSC-Regular;
  font-weight: 400;
  text-align: left;
  line-height: 0.4rem;
  margin-bottom: 0.76rem;
  text-indent: 1em;
 }
  </style>
</head>
<!--尽量不要在body上添加样式，除了背景色-->
<body>
<div>
  <!--具体代码-->

  <!-- 头部 -->
  <div class="messagedetail-header">
    <div class="seatBox"></div>
    <div class="header-title"> 
        <img src="../../images/allPic/baijiantou.png" alt="" onclick='closeWindow()'>
        <span>系统消息回复</span>
    </div>
    <div class="header-feedback">
    </div>
  </div>

  <!-- 标题内容 -->
  <div class="sysmessagedetail-contentBox">
    <div class="mainContent">
    </div>
  </div>
  
  <!-- 主体内容 -->
  <div class="sysexplain-content">
    <div class="explain-content-title">系统消息内容</div>
    <div class="explain-content-main">
        <!-- 您的反馈有新问题回复，点击跳转查看吧您的反馈有新问题回复，点击跳转查看吧您的反馈有新问题回复，点击跳转查看吧您的反馈有新问题回复 -->
    </div>

    <div class="imageBox" style='display: none;'>
      <div class="explain-content-title">上传截图</div>
      <div class="imgBox">
          <!-- <img src="" alt=""> -->
      </div>
    </div>
  </div>




</div>
</body>
<!--下面五个文件为固定引用，自己根据情况调整路径，不要跟换引入顺序，其他引用添加在后面-->
<script src="../../js/dict.js"></script>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/checkJsBridge.js"></script>
<script src="../../js/utils.js"></script>
<script src="../../js/api.js"></script>
<!--固定引用结束-->
<!--避免一个页面包含过多功能，减少js重绘页面，推荐分功能，分页面-->
<script>
  let pageNum = 1
  let imgUrls 
  /*固定页面初始化方法，用于替代$(function(){}),param为url参数，Object类型*/
  function initPage(params) {

    jsBridge.setWebFullScreen({'statusNumber':'1'})

    
    $('.seatBox').height(configHeight+'rem')

    //设置深色模式
    // if(configColorType === '1'){
    //     $('.headerimg').attr('src','../../images/allPic/blackfanhui.png')
    // }else{
    //     $('.headerimg').attr('src','../../images/allPic/jiantou.png')
    // }
    console.log(params)
    getsystemInfoDetail(params)
  }

  /*页面所在窗口由后台前台时触发的方法,param为url参数，Object类型*/
  function startPage(params) {

  }

  function reLoadPage() {

  }
  //查看反馈详情
  function getsystemInfoDetail(params){
    Server.myowninfo.systemInfoDetail({'articleId':params.articleId}).then(res => {
      console.log(res)
      if(res.code === 0){
        // 同步上一级页面刷新
        jsBridge.updateStatus({'type':'refresh','name':'refresh','infoId':'','value':'1'})
        //修改时间
        let exStartTime
        if(res.data.exStartTime){
           exStartTime = editTime(res.data.exStartTime)
        }else{
          exStartTime = ''
        }
        // let createdTime = editTime(res.data.createdTime)

        // console.log(answerDttm,createdTime)
        let top = 
            `<div class="mainContent-top">
                ${res.data.title}
            </div>
            <div class="mainContent-bottom">
                ${exStartTime}
            </div>`
        // let neck = 
        //     `<span class="type">意见类型</span>
        //     <span class="name">功能异常</span>
        //     <span class="time">${createdTime}</span>`

        let content = `<span>${res.data.msgConnect}</span>`

        if(res.data.imgUrls){
          $('.imageBox').show()
          imgUrls = res.data.imgUrl.split(',')
          // console.log(imgUrls)

          imgUrls.map((item,index) => {
            let image = `<img src="${item}" alt="">`
            $('.imgBox').append(image)
          })
        }else{
          $('.imageBox').hide()
        }


            $('.mainContent').append(top)
            // $('.explain-content-top').append(neck)
            $('.explain-content-main').append(content)
      }else{

      }
    })
  }
  //修改时间
  function editTime(time){
    let creatTime = time*1000             
    let nowTime = +new Date().valueOf()
    let year = new Date(creatTime).getFullYear()
    let month = new Date(creatTime).getMonth()+1<10?'0'+(new Date(creatTime).getMonth()+1):new Date(creatTime).getMonth()+1
    let day = new Date(creatTime).getDate()<10?'0'+new Date(creatTime).getDate():new Date(creatTime).getDate()
    let hour = new Date(creatTime).getHours()<10?'0'+ new Date(creatTime).getHours(): new Date(creatTime).getHours()
    let minute = new Date(creatTime).getMinutes()<10?'0'+new Date(creatTime).getMinutes():new Date(creatTime).getMinutes()
    if(nowTime - creatTime < 30*60*1000){
      if(nowTime - creatTime < 1*60*1000){
        time = '刚刚'
      }else{
        time = parseInt((nowTime - creatTime)/1000/60)+'分钟前'
      }
    }else if(nowTime - creatTime < 24*60*60*1000){
        if(nowTime-creatTime < 60*60*1000){
          time = '1小时前'
        }else {
          time = parseInt((nowTime - creatTime)/1000/60/60)+'小时前'
        }
    }else if(new Date().getDate()-new Date(creatTime).getDate()==1 && new Date().getMonth()==new Date(creatTime).getMonth() && new Date().getFullYear() == new Date(creatTime).getFullYear()){
      time = '昨天'+hour+":"+minute
    }else{
      time = year +'-'+ month+'-'+day+' '+hour+':'+minute
    }
    return time
  }
  //点击返回按钮
  function closeWindow(){
    jsBridge.closeWindows()
  }

</script>
</html>